When sending events to windows with a proxy, set the window field in the
authorOwen Taylor <otaylor@redhat.com>
Tue, 23 Feb 1999 00:43:26 +0000 (00:43 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 23 Feb 1999 00:43:26 +0000 (00:43 +0000)
Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>

* gdk/gdkdnd.c (xdnd_send_*): When sending events to
 windows with a proxy, set the window field in the
 sent event to the original window, not to the proxy.
 (This gives consistency with Motif, and also provides
  information to the destination that it wouldn't have
  otherwise).

* gtk/gtkdnd.c: Fixed some refcount leaks for windows.

* gdk/gdkdnd.c (xdnd_send_xevent): When sending
 Xdnd event to the root window, set the event mask
 to ButtonPressMask. Hopefully, this should give us
 compatibility with kfm, if it uses the Qt style
 of root window drops.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkdnd.c
gdk/x11/gdkdnd-x11.c
gtk/gtkdnd.c

index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index 4990aec0344cd1914727cf44fe2b3e3b4e8f12f2..d16adc67156b8b0ed9611232f9650ec4110c4cd0 100644 (file)
@@ -1,3 +1,20 @@
+Mon Feb 22 19:06:30 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+        windows with a proxy, set the window field in the
+        sent event to the original window, not to the proxy.
+        (This gives consistency with Motif, and also provides
+         information to the destination that it wouldn't have 
+         otherwise).
+       
+       * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+       * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+        Xdnd event to the root window, set the event mask
+        to ButtonPressMask. Hopefully, this should give us 
+        compatibility with kfm, if it uses the Qt style
+        of root window drops.
+
 Mon Feb 22 08:45:10 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml:
index a4244bd35ce64019ea4b4db7d657754b0ac8d2aa..55bd8b9ab676a3364f89ef5b7a11ff62a8a9346d 100644 (file)
@@ -23,6 +23,8 @@
 #include "gdk/gdkprivate.h"
 #include "gdk.h"
 
+#define NEW_DRAGS
+
 typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
 
 typedef enum {
@@ -177,16 +179,24 @@ gdk_drag_context_find (gboolean is_source,
 {
   GList *tmp_list = contexts;
   GdkDragContext *context;
+  GdkDragContextPrivate *private;
+  Window context_dest_xid;
 
   while (tmp_list)
     {
       context = (GdkDragContext *)tmp_list->data;
+      private = (GdkDragContextPrivate *)context;
+
+      context_dest_xid = context->dest_window ? 
+                          (private->dest_xid ?
+                             private->dest_xid :
+                             GDK_WINDOW_XWINDOW (context->dest_window)) :
+                          None;
 
       if ((!context->is_source == !is_source) &&
          ((source_xid == None) || (context->source_window &&
            (GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
-         ((dest_xid == None) || (context->dest_window &&
-           (GDK_WINDOW_XWINDOW (context->dest_window) == dest_xid))))
+         ((dest_xid == None) || (context_dest_xid == dest_xid)))
        return context;
       
       tmp_list = tmp_list->next;
@@ -2059,6 +2069,26 @@ xdnd_set_actions (GdkDragContext *context)
   private->xdnd_actions = context->actions;
 }
 
+/*************************************************************
+ * xdnd_send_xevent:
+ *     Like gdk_send_event, but if the target is the root
+ *     window, sets an event mask of ButtonPressMask, otherwise
+ *     an event mask of 0.
+ *   arguments:
+ *     
+ *   results:
+ *************************************************************/
+
+gint
+xdnd_send_xevent (Window window, gboolean propagate, 
+                 XEvent *event_send)
+{
+  if (window == gdk_root_window)
+    return gdk_send_xevent (window, propagate, ButtonPressMask, event_send);
+  else
+    return gdk_send_xevent (window, propagate, 0, event_send);
+}
+
 static void
 xdnd_send_enter (GdkDragContext *context)
 {
@@ -2068,7 +2098,13 @@ xdnd_send_enter (GdkDragContext *context)
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = (3 << 24); /* version */
   xev.xclient.data.l[2] = 0;
@@ -2097,8 +2133,8 @@ xdnd_send_enter (GdkDragContext *context)
        }
     }
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2113,18 +2149,26 @@ xdnd_send_leave (GdkDragContext *context)
 {
   XEvent xev;
 
+  GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
   xev.xclient.data.l[3] = 0;
   xev.xclient.data.l[4] = 0;
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2137,20 +2181,27 @@ xdnd_send_leave (GdkDragContext *context)
 static void
 xdnd_send_drop (GdkDragContext *context, guint32 time)
 {
+  GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
   XEvent xev;
 
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS  
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = time;
   xev.xclient.data.l[3] = 0;
   xev.xclient.data.l[4] = 0;
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2173,15 +2224,21 @@ xdnd_send_motion (GdkDragContext *context,
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif  
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = (x_root << 16) | y_root;
   xev.xclient.data.l[3] = time;
   xev.xclient.data.l[4] = xdnd_action_to_atom (action);
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -3075,8 +3132,8 @@ gdk_drag_status (GdkDragContext   *context,
       xev.xclient.data.l[3] = 0;
       xev.xclient.data.l[4] = xdnd_action_to_atom (action);
 
-      if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
-                      FALSE, 0, &xev))
+      if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+                            FALSE, &xev))
        GDK_NOTE (DND, 
                  g_message ("Send event to %lx failed",
                             GDK_WINDOW_XWINDOW (context->source_window)));
@@ -3146,8 +3203,8 @@ gdk_drop_finish (GdkDragContext   *context,
       xev.xclient.data.l[3] = 0;
       xev.xclient.data.l[4] = 0;
 
-      if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
-                      FALSE, 0, &xev))
+      if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+                            FALSE, &xev))
        GDK_NOTE (DND, 
                  g_message ("Send event to %lx failed",
                             GDK_WINDOW_XWINDOW (context->source_window)));
index a4244bd35ce64019ea4b4db7d657754b0ac8d2aa..55bd8b9ab676a3364f89ef5b7a11ff62a8a9346d 100644 (file)
@@ -23,6 +23,8 @@
 #include "gdk/gdkprivate.h"
 #include "gdk.h"
 
+#define NEW_DRAGS
+
 typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
 
 typedef enum {
@@ -177,16 +179,24 @@ gdk_drag_context_find (gboolean is_source,
 {
   GList *tmp_list = contexts;
   GdkDragContext *context;
+  GdkDragContextPrivate *private;
+  Window context_dest_xid;
 
   while (tmp_list)
     {
       context = (GdkDragContext *)tmp_list->data;
+      private = (GdkDragContextPrivate *)context;
+
+      context_dest_xid = context->dest_window ? 
+                          (private->dest_xid ?
+                             private->dest_xid :
+                             GDK_WINDOW_XWINDOW (context->dest_window)) :
+                          None;
 
       if ((!context->is_source == !is_source) &&
          ((source_xid == None) || (context->source_window &&
            (GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
-         ((dest_xid == None) || (context->dest_window &&
-           (GDK_WINDOW_XWINDOW (context->dest_window) == dest_xid))))
+         ((dest_xid == None) || (context_dest_xid == dest_xid)))
        return context;
       
       tmp_list = tmp_list->next;
@@ -2059,6 +2069,26 @@ xdnd_set_actions (GdkDragContext *context)
   private->xdnd_actions = context->actions;
 }
 
+/*************************************************************
+ * xdnd_send_xevent:
+ *     Like gdk_send_event, but if the target is the root
+ *     window, sets an event mask of ButtonPressMask, otherwise
+ *     an event mask of 0.
+ *   arguments:
+ *     
+ *   results:
+ *************************************************************/
+
+gint
+xdnd_send_xevent (Window window, gboolean propagate, 
+                 XEvent *event_send)
+{
+  if (window == gdk_root_window)
+    return gdk_send_xevent (window, propagate, ButtonPressMask, event_send);
+  else
+    return gdk_send_xevent (window, propagate, 0, event_send);
+}
+
 static void
 xdnd_send_enter (GdkDragContext *context)
 {
@@ -2068,7 +2098,13 @@ xdnd_send_enter (GdkDragContext *context)
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = (3 << 24); /* version */
   xev.xclient.data.l[2] = 0;
@@ -2097,8 +2133,8 @@ xdnd_send_enter (GdkDragContext *context)
        }
     }
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2113,18 +2149,26 @@ xdnd_send_leave (GdkDragContext *context)
 {
   XEvent xev;
 
+  GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
   xev.xclient.data.l[3] = 0;
   xev.xclient.data.l[4] = 0;
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2137,20 +2181,27 @@ xdnd_send_leave (GdkDragContext *context)
 static void
 xdnd_send_drop (GdkDragContext *context, guint32 time)
 {
+  GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
   XEvent xev;
 
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS  
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = time;
   xev.xclient.data.l[3] = 0;
   xev.xclient.data.l[4] = 0;
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -2173,15 +2224,21 @@ xdnd_send_motion (GdkDragContext *context,
   xev.xclient.type = ClientMessage;
   xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
   xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+  xev.xclient.window = private->dest_xid ? 
+                           private->dest_xid : 
+                           GDK_WINDOW_XWINDOW (context->dest_window);
+#else
   xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif  
   xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = (x_root << 16) | y_root;
   xev.xclient.data.l[3] = time;
   xev.xclient.data.l[4] = xdnd_action_to_atom (action);
 
-  if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
-                       FALSE, 0, &xev))
+  if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+                        FALSE, &xev))
     {
       GDK_NOTE (DND, 
                g_message ("Send event to %lx failed",
@@ -3075,8 +3132,8 @@ gdk_drag_status (GdkDragContext   *context,
       xev.xclient.data.l[3] = 0;
       xev.xclient.data.l[4] = xdnd_action_to_atom (action);
 
-      if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
-                      FALSE, 0, &xev))
+      if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+                            FALSE, &xev))
        GDK_NOTE (DND, 
                  g_message ("Send event to %lx failed",
                             GDK_WINDOW_XWINDOW (context->source_window)));
@@ -3146,8 +3203,8 @@ gdk_drop_finish (GdkDragContext   *context,
       xev.xclient.data.l[3] = 0;
       xev.xclient.data.l[4] = 0;
 
-      if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
-                      FALSE, 0, &xev))
+      if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+                            FALSE, &xev))
        GDK_NOTE (DND, 
                  g_message ("Send event to %lx failed",
                             GDK_WINDOW_XWINDOW (context->source_window)));
index c82d449f7e626f6df7173a1b5bee1df502688fd0..55103740a400e0105de76a8f6ea0d755a9e14578 100644 (file)
@@ -1385,6 +1385,9 @@ gtk_drag_dest_motion (GtkWidget        *widget,
                       context->suggested_action, 
                       context->actions, time);
 
+      if (!site->proxy_window && dest_window)
+       gdk_window_unref (dest_window);
+
       selection = gdk_drag_get_selection (info->proxy_source->context);
       if (selection && 
          selection != gdk_drag_get_selection (info->context))
@@ -1494,7 +1497,7 @@ gtk_drag_dest_drop (GtkWidget          *widget,
                                    current_event->dnd.y_root,
                                    &dest_window, &proto);
            }
-           
+
          gdk_drag_motion (info->proxy_source->context, 
                           dest_window, proto,
                           current_event->dnd.x_root, 
@@ -1502,6 +1505,9 @@ gtk_drag_dest_drop (GtkWidget          *widget,
                           context->suggested_action, 
                           context->actions, time);
 
+         if (!site->proxy_window && dest_window)
+           gdk_window_unref (dest_window);
+
          selection = gdk_drag_get_selection (info->proxy_source->context);
          if (selection && 
              selection != gdk_drag_get_selection (info->context))